<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="admin/inc/conn.inc"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>生成Club</title>
</head>

<body>
<%
	Id = SelfRequestNumber("id")
	if Id <> "" Then
		strSql = "select * from GameClub where ID=" & Id
		Set rs = Server.CreateObject("ADODB.Recordset")
		rs.Open strSQL, dbconnection, adOpenDynamic, 3
		if(rs.Eof) then
			response.Write("Id 出错")
			response.end		
		else
			Const ForReading = 1, ForWriting = 2   
			Dim fso, f   
			Set fso = CreateObject("Scripting.FileSystemObject")   
			Set f = fso.OpenTextFile(server.mappath("clubvip\Framework.htm"), ForReading)
			ReadAllTextFile = f.ReadAll   
			ReadAllTextFile = replace(ReadAllTextFile,"$Name$",rs("Name")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$Title$",rs("Title")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$Pic$",rs("Pic")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$Addr$",rs("Addr")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$Tel$",rs("Tel")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$QQ$",rs("QQ")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$Other$",rs("Other")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$Map$",rs("Map")) 
			ReadAllTextFile = replace(ReadAllTextFile,"$Summary$",rs("Summary"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_1$",rs("call_1"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_2$",rs("call_2"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_3$",rs("call_3"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_4$",rs("call_4"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_5$",rs("call_5"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_6$",rs("call_6"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_7$",rs("call_7"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_8$",rs("call_8"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_9$",rs("call_9"))
			ReadAllTextFile = replace(ReadAllTextFile,"$call_10$",rs("call_10"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_1$",rs("callname_1"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_2$",rs("callname_2"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_3$",rs("callname_3"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_4$",rs("callname_4"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_5$",rs("callname_5"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_6$",rs("callname_6"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_7$",rs("callname_7"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_8$",rs("callname_8"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_9$",rs("callname_9"))
			ReadAllTextFile = replace(ReadAllTextFile,"$callname_10$",rs("callname_10"))
			
			Dim objTypeLib
			Set objTypeLib = CreateObject("Scriptlet.TypeLib")
			strURL = objTypeLib.Guid
			strURL = Mid(strURL, 1, Len(strURL) - 2)
			rs("URL") = strURL
			rs.update
			
			Set f = fso.OpenTextFile(server.mappath("clubvip\" & rs("URL") & ".htm"), ForWriting, True)   
			f.Write ReadAllTextFile
			Response.Write("<meta HTTP-EQUIV=REFRESH CONTENT='1; URL=/clubvip/"&rs("URL")&".htm'>生成成功，一秒钟后自动返回")
			Set f = Nothing
		end if
		set rs = nothing
	else
		response.Write("Id 出错")
		response.end	
	end if	
%>
</body>
</html>
<!--#include file="disconn.inc"-->